
sbit RS=P2^1;
sbit RW=P2^2;
sbit EN=P2^3;
sbit D=P3^6;
sbit W=P3^7;

void delay(uint a)
{
	uchar i;
	uint j;
	for (i=0;i<110;i++)
		for(j=0;j<a;j++);
}	
void Write_com(uchar com)
{
	RS=0;
	RW=0;
	P0=com;
	delay(5);
	EN=1;
	delay(5);
	EN=0;	
}
void Write_data(uchar dat)
{
	RS=1;
	RW=0;
	P0=dat;
	delay(1);
	EN=1;
	delay(1);
	EN=0;
		
}
 void _1602init()
{
	D=0;
	W=0;
	EN=0;
	Write_com(0x83);
	Write_com(0x01);
	Write_com(0x0c);
	Write_com(0x06);
}
